package com.itheima.ManyToMany;

import com.itheima.bean.Student;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface StudentMapper {
    @Select("select * from student ")
    @Results({
            @Result(id = true,property = "id",column = "id"),
            @Result(property = "name",column = "name"),
            @Result(property = "age",column = "age"),
            @Result(property = "crouse",javaType = List.class,
            column = "id",
            many=@Many(select = "com.itheima.ManyToMany.CrouseMapper.findByStudentId"))

    })
    public List<Student>  findAll();

}
